#include "mymusic.h"
#include "ui_mymusic.h"

mymusic::mymusic(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::mymusic)
{
    ui->setupUi(this);
    initUI();
    readFile();
}

mymusic::~mymusic()
{
    delete ui;
}
void mymusic::readFile()
{
  str_pathmusic="D:/BaiduNetdiskDownload/music";
  QDir dir(str_pathmusic);
  QStringList namefilters;
  namefilters<<"*.wav";
  QStringList files=dir.entryList(namefilters,QDir::Files|QDir::Readable,QDir::Name);
  ui->listWidget->addItems(files);
  ui->listWidget->sortItems();
  p_item=ui->listWidget->item(0);
  p_item->setSelected(true);

}
void mymusic::initUI()
{

}
void mymusic::paintEvent(QPaintEvent *event)
{

    QStyleOption opt;
    opt.initFrom(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget,&opt,&p,this);
}
